package abstractaspects;

/**
 * A class that needs to be declared as parent on the class that is used as authorization
 * object
 * @author erwin
 *
 */
public abstract class Authenticable {
	
	private boolean authorized = false;
	
	/**
	 * 
	 * @param token some string to validate identity
	 * @return boolean if authorization is succesfull 
	 */
	protected abstract boolean authorize (String token);
	
	protected void setAuthorized() {
		this.authorized = true;
	}
	
	public boolean authorized() {
		return this.authorized;
	}
}
